package edu.biwu.filter01;

import jakarta.servlet.*;

import java.io.IOException;

public class FilterDemo02 implements Filter {

    @Override
    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
        System.out.println("FilterDemo02开始执行"+request+"..."+response);
        chain.doFilter(request, response);//一旦执行该方法,就相当于过滤器放行,去访问目标资源
        System.out.println("FilterDemo02结束执行");

        response.setContentType("text/html;charset=UTF-8");
        response.getWriter().write("FilterDemo02的响应");
    }
}
